package com.example.meterialproject.activitys.transition.demo2

import android.os.Bundle
import coil.load
import com.example.meterialproject.base.BaseActivity
import com.example.meterialproject.databinding.ActivityTransitionTo2Binding

/**
 *
 * @ClassName: TransitionDemoTo2Activity
 * @Author: android 超级兵
 * @CreateDate: 4/27/22$ 10:24 AM$
 * TODO
 */
class TransitionDemoTo2Activity : BaseActivity<ActivityTransitionTo2Binding>() {
    companion object {
        const val TRANSITION_NAME = "TransitionName"
        const val BACKGROUND_COLOR = "backgroundColor"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        intent.getStringExtra(TRANSITION_NAME)?.also {
            binding.parentView.transitionName = it

            binding.imagView.load(it)
        }

        intent.getIntExtra(BACKGROUND_COLOR, -1).also {
            binding.parentView.setBackgroundColor(it)
        }
    }
}